package cn.funeralobjects.ams.entity;

import cn.funeralobjects.ams.converter.AccessKeyStatusConverter;
import cn.funeralobjects.ams.enums.AccessKeyStatus;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author FuneralObjects
 * Create date: 2020/5/25 10:26 AM
 */
@Entity
@Table(name = "t_access_key")
@DynamicInsert
@DynamicUpdate
@Data
@Accessors(chain = true)
public class EAccessKey {
    /**
     * 所属权限
     */
    @Id
    private Integer accessId;
    /**
     * 阿里权限id
     */
    private String accessKeyId;
    /**
     * 阿里权限秘钥
     */
    private String accessKeySecret;
    /**
     * 密钥状态
     */
    @Convert(converter = AccessKeyStatusConverter.class)
    private AccessKeyStatus status;
    /**
     * 最近一次检测时间
     */
    private Date lastCheck;

}
